<!DOCTYPE html>
<html>
  <%= head(inline_assets) %>
  <body>

    <%= header(input_name) %>

    <%= render_system_info(suite.system) %>

    <%= if all_scenarios_processed?(suite.scenarios, :run_time) do %>
      <article>
        <h2>
          Run Time Comparison
          <a href="https://github.com/PragTob/benchee_html/wiki/Chart-Types#comparison">
            <i
            class="benchee-help-icon icon-question-circle-o"
            title="Comparisons of the different benchmarking jobs. For Iterations per Second higher is better, the black whiskers denote standard deviation. otherwise it is runtime so lower is better. The Box Plot shows a distribution of run times with the median and outliers."
            ></i>
          </a>
        </h2>
        <section>
          <%= render_data_table(suite.scenarios, :run_time_data, units, path_information: {suite.filename, input_name}) %>
        </section>

        <section class="benchee-plot-container">
          <div id="ips-comparison" class="<%= max_width_class(suite.job_count) %> plot"></div>
        </section>

        <section class="benchee-plot-container">
          <div id="run-time-box-plot" class="<%= max_width_class(suite.job_count) %> plot"></div>
        </section>
      </article>
    <% end %>

    <%= if all_scenarios_processed?(suite.scenarios, :memory) do %>
      <article>
        <h2>
          Memory Usage Comparison
          <a href="https://github.com/PragTob/benchee_html/wiki/Chart-Types#comparison">
            <i
            class="benchee-help-icon icon-question-circle-o"
            title="This is a memory usage comparison"
            ></i>
          </a>
        </h2>
        <section>
          <%= render_data_table(suite.scenarios, :memory_usage_data, units, path_information: {suite.filename, input_name}) %>
        </section>

        <section class="benchee-plot-container">
          <div id="memory-comparison" class="<%= max_width_class(suite.job_count) %> plot"></div>
        </section>

        <section class="benchee-plot-container">
          <div id="memory-box-plot" class="<%= max_width_class(suite.job_count) %> plot"></div>
        </section>
      </article>
    <% end %>

    <footer>
      <%= render_footer() %>
    </footer>

    <%= js_includes(inline_assets) %>

    <script>
      var scenarios     = <%= scenarios_json %>;
      var inputHeadline = "<%= input_headline(input_name) %>";

      <%= if all_scenarios_processed?(suite.scenarios, :run_time) do %>
        drawIpsComparisonChart(scenarios, inputHeadline);
        drawRunTimeComparisonBoxPlot(scenarios, inputHeadline);
      <% end %>

      <%= if all_scenarios_processed?(suite.scenarios, :memory) do %>
        drawMemoryComparisonChart(scenarios, inputHeadline);
        drawMemoryComparisonBoxPlot(scenarios, inputHeadline);
      <% end %>
    </script>
  </body>
</html>
